package com.probox.common.entity.vo.centre.customer;

import cn.hutool.core.date.DateUtil;
import com.probox.common.core.utils.SecurityUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author Kite
 * @date 2021/7/23
 */
@Data
public class CustomerQueryVo implements Serializable {
    @ApiModelProperty(value = "开始统计时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;
    @ApiModelProperty(value = "结束统计时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;
    @ApiModelProperty(value = "会员ID")
    private List customerUid ;

    @ApiModelProperty(value = "平台Id")
    private Long platformId;

    public Long getPlatformId() {

        return  SecurityUtils.getPlatformId();
    }

    public Date getEndTime() {
        if (endTime!=null){
            endTime = DateUtil.endOfDay(endTime);
        }
        return  endTime;
    }

    public Date getStartTime() {
        if (endTime!=null){
            endTime = DateUtil.beginOfDay(endTime);
        }
        return startTime;
    }
}
